﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LapSim {
    class Vector {
        public double x = 0.0, y = 0.0, z = 0.0;

        public Vector( double _x = 0.0, double _y = 0.0, double _z = 0.0 ) {
            x = _x;
            y = _y;
            z = _z;
        }

        public double Cross( Vector b ) {
            return x * b.x + y * b.y + z * b.z;
        }

        public static Vector operator+(Vector a, Vector b) {
            return new Vector( a.x + b.x, a.y + b.y, a.z + b.z );
        }

        public static Vector operator-( Vector a, Vector b ) {
            return new Vector( a.x - b.x, a.y - b.y, a.z - b.z );
        }

        public static Vector operator*(Vector a, double s) {
            return new Vector(a.x * s, a.y * s, a.z * s);
        }

        public override string ToString() {
            return x.ToString( CultureInfo.InvariantCulture ) + ", " +
                y.ToString( CultureInfo.InvariantCulture ) + ", " +
                z.ToString( CultureInfo.InvariantCulture );
        }
    }
}
